<?php
    /**
     *  Script which handles actions according to the request query parameters.
     *  if action == 'logout' => logs out the user 
     *  if action == 'locationupdate' => updates the user location accroding to other parameters. For more info see updateLocation.php.
     *  
     */
    
    include_once 'User.php';
    include_once './log4php/Logger.php';

    Logger::configure('./log4j.properties');

    $log = Logger::getLogger(basename(__FILE__));
    $log->debug('[START] ' . basename(__FILE__));
//    Logger::logPHPGlobals(true, true, true, true);
    $log->debug('action=' . (isset($_REQUEST['action']) ? $_REQUEST['action'] : 'undefined'));
    
    if (isset($_REQUEST['action']) && 
      ($_REQUEST['action']=='locationupdate' || $_REQUEST['action']=='locationpublish' || $_REQUEST['action']=='locationpublishdenied')) {
        include 'updateLocation.php';
    }
    
    $log->debug('[ END ] ' . basename(__FILE__));
?>